package com.dwxt.cdms.applets;

import com.dwxt.cdms.applets.dto.IndexReqDTO;
import com.dwxt.cdms.applets.service.GraphService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

@RestController
@RequestMapping("/cdms/graph")
public class GraphController {

    @Autowired
    private GraphService graphService;

    /**
     * 小程序首页 图表
     * @param customerId
     * @return
     */
    @RequestMapping("/index")
    public BaseResult index(Integer customerId) {
        return graphService.index(customerId);
    }


    /**
     *根据 设备种类 返回相应数据类型 数据
     * @param indexReqDTO
     * @return
     */
    @RequestMapping("/index2")
    public BaseResult index2(IndexReqDTO indexReqDTO) throws ParseException {
        return graphService.index2(indexReqDTO);
    }

}
